package com.feature.core.config;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.lang3.StringUtils;
import org.mapstruct.Named;

public class MapstructTypeConvert {

	@Named("stringToInts")
	public List<Integer> stringToInts(String strs) {
		if (StringUtils.isBlank(strs)) {
			return null;
		}
		return Stream.of(strs.split(",")).map(Integer::valueOf).collect(Collectors.toList());
	}
	
	@Named("stringToArray")
    public List<String> stringToArray(String strs) {
        if (StringUtils.isBlank(strs)) {
            return null;
        }
        return Stream.of(strs.split("#&#")).collect(Collectors.toList());
    }
}
